package com.xinya.wanandroidclient.ui.square

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.xinya.wanandroidclient.Constants
import com.xinya.wanandroidclient.base.BaseViewModel
import com.xinya.wanandroidclient.bean.NaviBean
import com.xinya.wanandroidclient.bean.SystemBean

/**
 *
 * @ClassName:      SquareViewModel$
 * @Description:    java类作用描述
 * @Author:         xinya
 * @CreateDate:     2021/3/3$ 18:51$
 * @UpdateRemark:   更新内容
 * @Version:        1.0
 */
class SquareViewModel : BaseViewModel() {

    private val repo by lazy {
        SquareRepo(viewModelScope)
    }

    val systemListViewModel by lazy {
        MutableLiveData<MutableList<SystemBean>>()
    }

    val navListViewModel by lazy {
        MutableLiveData<MutableList<NaviBean>>()
    }

    fun getClassList(fragmentType: Int) {
        if (fragmentType == Constants.NAV_PROJECT) {
            repo.getSystemList(systemListViewModel, refreshStateLiveData)
        } else {
            repo.getNavList(navListViewModel, refreshStateLiveData)
        }
    }



}